home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1980-05-17 | 3.1 KB | 66 lines |
- '****************ITS THE CACOPHONY CARTOON CLUB!-By Mark Wickson*********************
- Rem You may have written a wonderful game,but what happens when you want
- Rem to make one of your sprites/bobs become animated-But you don't actually
- Rem want to do it by adding to,or taking away from a variable.So thats
- Rem where Amal comes in-Its a special sub-language that only users of
- Rem the original AMOS and "AMOS Pro" can use.
- Rem When making your Bob/Sprite banks you should consider if you want
- Rem anything to be animated-If so design your bank accordingly.
- Rem Here we load in the JUMP.Abk file which contains three images,those
- Rem of a little man jumping in the air-You could have many more frames,but
- Rem this is just a simple example.
- Rem First we place Bob one rougly in the centre of the screen with
- Rem "Bob 1,150,110,1"
- Rem Then,in order for AMOS to know that Bob 1 is to be animated,we have
- Rem to assign an AMAL channel to it,this is simply done by typing
- Rem Channel
- Rem and then we have todecide which channel we want to use,since we
- Rem haven't used any others yet,we can start with channel 1
- Rem Channel 1 To Bob
- Rem (The above "Bob" can be changed to "Sprite" if you're using sprites)
- Rem Now we decide which Bob/Sprite we want to animate-We want it
- Rem to be bob 1,so we'd write:
- Rem Channel 1 To Bob 1
- Rem You can have as many moving or animating Bobs/Sprites as you want.
- Rem Since we have declared that channel 1 is to be allocated to Bob 1,we must
- Rem now say what animation the Bob will undergo(This could be movement-But
- Rem here we just flip through some of its images)-So type:
- Rem Amal
- Rem and then the number of the channel you are going to define,in this case
- Rem its "1":
- Rem Amal 1,""
- Rem Since we want to animate the Bob we put the Anim command inside
- Rem the brackets,and then the number of times we want the animation to
- Rem play-zero is `forever'.
- Rem Amal 1,"Anim 0, "
- Rem Next,you must put the first image number of your animation,then a comma,
- Rem then the time you want the image to screen for before showing the next one
- Rem -This time is measured in 50ths of a second,here we start with image
- Rem one and pause for point seven of a second.
- Rem Amal 1,"Anim 0,(1,7) "
- Rem then you do the same thing for the next frame,like this:
- Rem Amal 1,"Anim 0,(1,7)(2,7)"
- Rem And so on,adding as many frames as you want.
- Rem Notice we don't put commas between the brackets.
- Rem We then have to turn the amal channels on,this can be done either
- Rem by using the "Amal On" command,which turns on all Amal channels,
- Rem or by typing "Amal On and then the number of the channel we want to
- Rem turn on,in this case channel 1.
- Rem we then have to set up a "Do....Loop"-If we didn't(Because the
- Rem program is so short)the program would end before we even saw the Bob.
- Rem You won't usaually need to do this in a program,unless its VERY
- Rem short.
- Rem NOTE:You must have put the Bob/sprite on screen or AMOS will turn the
- Rem Amal channel on ,but you won't see anything.
- Screen Open 0,320,256,16,Lowres
- Load "ATTBG:JUMP.Abk"
- Get Sprite Palette
- Flash Off
- Curs Off
- Cls 0
- Bob 1,150,110,1
- Channel 1 To Bob 1
- Amal 1,"Anim 0,(1,7)(2,7)(3,7)"
- Amal On 1
- Do
- Loop